package com.codingman.springbootdemo4;

import org.springframework.beans.factory.annotation.Required;

/*
 * @Required：
 * 它适用于bean setter 方法。它表示必须在配置时使用所需的属性填充带注释的bean，
 * 否则它会抛出异常BeanInitilizationException。
 */
public class Machine {
	private Integer cost;

	@Required
	public void setCost(Integer cost) {
		this.cost = cost;
	}

	public Integer getCost() {
		return cost;
	}
	
	public Machine(Integer cost) {}
}
